<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>comic</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link type="text/css" rel="stylesheet" href="../../css/pepper-grinder/jquery-ui-1.8.16.custom.css" />
	<link type="text/css" rel="stylesheet" href="css/comic.css" />
	<script type="text/javascript" src="../../js/jquery.min.js"></script>
	<script type="text/javascript" src="../../js/jquery-ui-1.8.16.custom.min.js"></script>
	<script type="text/javascript" src="../../js/jquery.mousewheel.min.js"></script>
	<script language="JavaScript" type="text/JavaScript">
		var hidediv1 = 1;
		var divcount1= 0;
		var hidediv2 = 1;
		var divcount2 = 0;
		var hidediv3 = 1;
		var divcount3 = 0;
		$(document).ready(function() {
			
			var rmids = ["d96c1c57-e4e2-4e33-b55e-9e7a2d0d79aa","82fcdc5e-7bb9-4be5-b276-1113a0febb48","9238d33e-5dac-4d95-a734-4d14bb731f85"];
			var tjids = ["62ec9a41-2fe4-42a1-b407-3a1a7a7fc8c4","5a21670e-48c8-404f-bc85-35543c69dee4","05318b23-089d-4951-8228-9aae95926d48"];
			
			
				
			$.getJSON("comic_searchTop10ByOrder.do",{},function(json){
				divcount1 = json.length;
				for(var i=0;i<json.length;i++){
					var divstr = '<div class="comic1" style="width:100%;float:left;"><div class="imgdiv" style="padding-left:15px;padding-top:15px;float:left;"><img onclick="showComic(this)" id="'+json[i].id+'" src="'+json[i].pageurl+'" style="width:100%;height:100%;cursor:pointer;border:#f8f7f0 2px solid;"/></div><div  style="float:left;padding-left:15px;padding-top:15px;" ><div style="padding-top:5px;">'+json[i].name+'</div><div style="padding-top:5px;">'+"更新至："+json[i].state+'</div><div style="padding-top:5px;">'+"作者："+json[i].author+'</div></div></div>';
					$("#tab-1").append(divstr);
				}
				
				
				refresh();
			});
		

		
			
			$.getJSON("comic_searchTop10ByRec.do",{},function(json){
				divcount2 = json.length;
				for(var i=0;i<json.length;i++){
					var divstr = '<div class="comic2" style="width:100%;float:left;"><div class="imgdiv" style="padding-left:15px;padding-top:15px;float:left;"><img onclick="showComic(this)" id="'+json[i].id+'" src="'+json[i].pageurl+'" style="width:100%;height:100%;cursor:pointer;border:#f8f7f0 2px solid;"/></div><div  style="float:left;padding-left:15px;padding-top:15px;" ><div style="padding-top:5px;">'+json[i].name+'</div><div style="padding-top:5px;">'+"更新至："+json[i].state+'</div><div style="padding-top:5px;">'+"作者："+json[i].author+'</div></div></div>';
					$("#tab-2").append(divstr);
				}
				
				refresh();
			});
			
			$(window).resize(function() {
				refresh();
			});
			refresh();
			$( "#navigation" ).tabs();
			
			$('#tab-1').mousewheel(function(event, delta, deltaX, deltaY) {
				if (delta > 0){
					if(hidediv1>1){
						$(".comic1:nth-child("+hidediv1+")").show();
						hidediv1--;
					}else{
						$(".comic1:nth-child("+hidediv1+")").show();
					}
				}else if (delta < 0){
					if(hidediv1<divcount1-2){
						$(".comic1:nth-child("+hidediv1+")").hide();
						hidediv1++;
					}
				}else{
				
				}
				return false; // prevent default
			});
			$('#tab-2').mousewheel(function(event, delta, deltaX, deltaY) {
				
				if (delta > 0){
					if(hidediv2>1){
						$(".comic2:nth-child("+hidediv2+")").show();
						hidediv2--;
					}else{
						$(".comic2:nth-child("+hidediv2+")").show();
					}
				}else if (delta < 0){
					if(hidediv2<divcount2-2){
						$(".comic2:nth-child("+hidediv2+")").hide();
						hidediv2++;
					}
				}else{
				
				}
				return false; // prevent default
			});
			$('#tab-3').mousewheel(function(event, delta, deltaX, deltaY) {
				
				if (delta > 0){
					if(hidediv3>1){
						$(".comic3:nth-child("+hidediv3+")").show();
						hidediv3--;
					}else{
						$(".comic3:nth-child("+hidediv3+")").show();
					}
				}else if (delta < 0){
					if(hidediv3<divcount3-2){
						$(".comic3:nth-child("+hidediv3+")").hide();
						hidediv3++;
					}
				}else{
				
				}
				return false; // prevent default
			});
		
		});

		function refresh(){
			var winheight = $(window).height();
			var winwidth = $(window).width();
			$("#bodydiv").css("height",winheight-38);
			$(".subtab").css("height",winheight-55);
			$(".imgdiv").css("width",winheight*0.15);
			$(".imgdiv").css("height",winheight*0.20);
		}

		function showComic(obj){
			
			window.parent.showapp("compents/comic/showcomic.html?id="+obj.id);
		}

		
	</script>
</head>
<body style="background-color=transparent;width:100%;margin-left:0px;margin-top:0px;">
	<div id="bodydiv" style="background:url(../../css/pepper-grinder/images/ui-bg_fine-grain_10_eceadf_60x60.png)">
		

		<div id="navigation" class="navigation">
			<ul>
				<li><a href="#tab-1" >推荐</a></li>
				<li><a href="#tab-2" >热门</a></li>
				<li><a href="#tab-3" >书架</a></li>
			</ul>
			<div id="tab-1" class="subtab" style="overflow:hidden;">
				
				
			</div>
			<div id="tab-2" class="subtab" style="overflow:hidden;">
			
			</div>
			<div id="tab-3" class="subtab" style="overflow:hidden;">
			
			</div>
		</div>
	</div>
	
	
	
</body>
</html>